<?
    if (!isset($id)) $id = 0;
    $id += 0;
    $q = $db->query("SELECT * FROM cms WHERE id = '".$id."'");
?>

<? if ($r = $db->fetch($q)) : ?>
    <div class="breadcrumb">
        <a href="/" title="<?php echo get_title(); ?>">Trang chủ</a> &raquo; <a href="<?php echo lg_string::get_link("dich-vu")?>">Dịch vụ</a> <?php echo get_cms_breadcrumb($r['cat']); ?> &raquo; <span><?php echo $r['ten']?></span>
    </div>
    <div class="box_title">
        <h1><?=($r['ten'])?></h1>
    </div>
    <div class="box-container">
        <div class='desc_tin'><?=$r['chu_thich']?></div>
        <div style='padding:10px 0;'><?=$r['noi_dung']?></div>
    </div>
    
    <div class="box_title">
        <h1>Những Dịch vụ khác</h1>
    </div>
    <?php
    $q1 = $db->query("SELECT * FROM cms WHERE id <> '".$id."' AND cat = '".$r['cat']."' AND hien_thi = 1 ORDER BY time DESC LIMIT 4");
    ?>
    <? if ($db->num_rows($q1) > 0) : ?>
        <div class="box-container">
            <?php
            $cg = 0;
            while ($r1 = $db->fetch($q1))
            {
                $cg ++;
            ?>
                <div class='tin_moi_list' <?=($cg % 2 == 0)?"style='padding-left:15px;'":"style=''"?>>
                    <div style='padding-bottom:10px;' class="name"><a href='/dich-vu-xem/<?=$r1['id']?>/<?=lg_string::get_link($r1['ten'])?>'><?=$r1['ten']?></a></div>
                    <div class='img_tin'><a href="/dich-vu-xem/<?=$r1['id']?>/<?=lg_string::get_link($r1['ten'])?>"><img src='/uploads/cms/cms_<?=$r1['hinh']?>' /></a></div>
                    <div class='tom_tat_tin_moi'>
                        <?=lg_string::crop($r1['chu_thich'],50)?> 
                    </div>
                </div>
            <?
            }
            ?>
            <div class="clearfix"></div>
        </div>
    <? endif; ?>
<? else : ?>
    <div class="breadcrumb">
        <a href="/" title="<?php echo get_title(); ?>">Trang chủ</a> &raquo; <a href="<?php echo lg_string::get_link("dich-vu")?>">Dịch vụ</a> 
    </div>
    <div class="box-container">
        Dịch vụ không tồn tại
    </div>
<? endif; ?>
